﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.ThrongIn.DAL;
using Com.ThrongIn.BE;
using Com.ThrongIn.Utilities;
using System.Web.UI.WebControls;
using System.Data;
namespace Com.ThrongIn.BLL
{
    public class CategoryBLL
    {
        #region Properties
        private CategoryDAL ObjCategoryDAL
        {
            get
            {
                return new CategoryDAL();
            }
        }
        #endregion
        /// <summary>
        /// 
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        public List<Category> GetCategoryForBreadCrumb(Int64 categoryId)
        {
            return ObjCategoryDAL.GetCategoryForBreadCrumb(categoryId);
        }
        /// <summary>
        /// Get Menu in xml
        /// </summary>
        /// <returns></returns>
        public XmlDataSource GetMenu()
        {
            DataSet ds = ObjCategoryDAL.GetMenu();

            XmlDataSource xmlDS = new XmlDataSource();
            xmlDS.Data = ds.GetXml();
            xmlDS.TransformFile = "~/XSLT/TransformMenuXml.xslt";
            xmlDS.XPath = "MenuItems/MenuItem";
            xmlDS.EnableCaching = false;
            return xmlDS;
        }
       
    }
}
